class Product {
  Product({
    String? id,
    String? createTime,
    String? updateTime,
    String? title,
    String? coverAddr,
    String? price,
    String? description,
    String? rate,
    String? detailAddr,
    num? stockpile,
    List<SpecificationList>? specificationList,}){
    _id = id;
    _createTime = createTime;
    _updateTime = updateTime;
    _title = title;
    _coverAddr = coverAddr;
    _price = price;
    _description = description;
    _rate = rate;
    _detailAddr = detailAddr;
    _stockpile = stockpile;
    _specificationList = specificationList;
  }

  Product.fromJson(dynamic json) {
    _id = json['id'];
    _createTime = json['createTime'];
    _updateTime = json['updateTime'];
    _title = json['title'];
    _coverAddr = json['coverAddr'];
    _price = json['price'];
    _description = json['description'];
    _rate = json['rate'];
    _detailAddr = json['detailAddr'];
    _stockpile = json['stockpile'];
    if (json['specifications'] != null) {
      _specificationList = [];
      json['specifications'].forEach((v) {
        _specificationList?.add(SpecificationList.fromJson(v));
      });
    }
  }

  String? _id;
  String? _createTime;
  String? _updateTime;
  String? _title;
  String? _coverAddr;
  String? _price;
  String? _description;
  String? _rate;
  String? _detailAddr;
  num? _stockpile;
  List<SpecificationList>? _specificationList;



  String? get id => _id;
  String? get createTime => _createTime;
  String? get updateTime => _updateTime;
  String? get title => _title;
  String? get coverAddr => _coverAddr;
  String? get price => _price;
  String? get description => _description;
  String? get rate => _rate;
  String? get detailAddr => _detailAddr;
  num? get stockpile => _stockpile;
  List<SpecificationList>? get specificationList => _specificationList;

  set coverAddr(String? value) {_coverAddr = value;}

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['createTime'] = _createTime;
    map['updateTime'] = _updateTime;
    map['title'] = _title;
    map['coverAddr'] = _coverAddr;
    map['price'] = _price;
    map['description'] = _description;
    map['rate'] = _rate;
    map['detailAddr'] = _detailAddr;
    map['stockpile'] = _stockpile;
    if (_specificationList != null) {
      map['specificationList'] = _specificationList?.map((v) => v.toJson()).toList();
    }
    return map;
  }

}

class SpecificationList {
  SpecificationList({
    String? id,
    String? item,
    String? value,}){
    _id = id;
    _item = item;
    _value = value;
  }

  SpecificationList.fromJson(dynamic json) {
    _id = json['id'];
    _item = json['item'];
    _value = json['value'];
  }
  String? _id;
  String? _item;
  String? _value;

  String? get id => _id;
  String? get item => _item;
  String? get value => _value;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['item'] = _item;
    map['value'] = _value;
    return map;
  }

}